package com.tanhua.model.vo;

import com.tanhua.model.domain.Announcement;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.beans.BeanUtils;

/**
 * @Description: test
 * @Create by: JJ菜菜
 * @Date: 2021/12/11 18:25
 */

@Data
@AllArgsConstructor
@NoArgsConstructor
public class AnnouncementVo {

    private String id;
    private String title;
    private String description;
    private String createDate;

    public static AnnouncementVo init(Announcement announcement, String createDate){

        AnnouncementVo vo = new AnnouncementVo();
        if (announcement != null){
            BeanUtils.copyProperties(announcement, vo);
            vo.setCreateDate(createDate);
        }
        return vo;
    }

}
